Skip to content

perf(admin): 用户列表直接读取内存(v0.5.0) - #6629

Merged
qin-ctx merged 1 commit into
release/v0.5.0-hotfixfrom
perf/list-users-memory-v0.5.0
Oct 26, 2026
Merged

qin-ctx merged 1 commit into
release/v0.5.0-hotfixfrom
perf/list-users-memory-v0.5.0

Conversation

@qin-ctx

@qin-ctx qin-ctx commented Oct 26, 2026

Copy link
Copy Markdown
Collaborator

Description

未启动后台 watcher 时,HTTP 和 MCP 的 list_users 每次都会重新读取该账户的用户登记文件并重建索引,查询一页用户也承担全量刷新的开销。改为直接读取当前进程的内存登记信息,保留原有返回字段、鉴权、过滤、分页和统计,不增加接口或参数。

例如,本进程已创建 alice 和 bob 后查询 GET /api/v1/admin/accounts/acme/users:修改前仍需读取用户文件,存储读取失败会导致查询失败;修改后直接返回包含 alice、bob 的原有用户列表,文件存储暂时不可读也不影响该查询。

跨进程可见性随之调整:本进程完成的用户修改立即可见;其他进程的修改需等待后台同步或登记信息重新加载。

Human Involvement

  • A human participated in the implementation or review loop
  • This PR was generated entirely by AI agents without human participation in the loop

Related Issue

无关联 Issue。

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Refactoring (no functional changes)
  • Performance improvement
  • Test update

Changes Made

  • 移除 HTTP 和 MCP 用户列表入口的主动文件刷新。
  • 改写一个现有契约测试,验证用户创建完成后,即使存储读取不可用,两个入口仍返回内存用户列表。
  • 更新中英文文档,明确内存读取及跨进程更新可见性。

Testing

6 项定向测试通过,覆盖无存储读取、空用户列表、watcher 场景、过滤分页及统计、账户权限、角色修改;Ruff 和 git diff --check 通过。改写了现有测试,没有新增测试函数或文件。

  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • I have tested this on the following platforms:
    • Linux
    • macOS
    • Windows

Checklist

  • My code follows the project's coding style
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • Any dependent changes have been merged and published

Screenshots (if applicable)

不适用。

Additional Notes

目标分支为 release/v0.5.0-hotfix,本 PR 无前置依赖。实现只删除原有刷新步骤,无新增复杂逻辑。

@qin-ctx
qin-ctx merged commit 5e45a87 into release/v0.5.0-hotfix Oct 26, 2026
2 checks passed
@qin-ctx
qin-ctx deleted the perf/list-users-memory-v0.5.0 branch October 26, 2026 14:21
@github-project-automation github-project-automation Bot moved this from Backlog to Done in OpenViking project Oct 26, 2026
@runyunzhou runyunzhou mentioned this pull request Oct 27, 2026
15 of 21 tasks
qin-ctx added a commit that referenced this pull request Oct 27, 2026
* fix(storage): 升级后继续隐藏旧版多写元数据

(cherry picked from commit 2bef4c2)
(cherry picked from commit 236e3c4)

Co-authored-by: TRAE CLI <traecli@bytedance.com>

* fix(ragfs): backport multiwrite hotfixes to v0.5.0 (#6607)

* fix(ragfs): 在外部租约下跳过冗余加密锁

(cherry picked from commit 002b27f)

* fix(multiwrite): 取消删除 v1 元数据时 glob 操作,在 import account 阶段进行删除 && 增加迁移阶段执行进度日志

(cherry picked from commit 42d99d8)
(cherry picked from commit d8dd90d)

Co-authored-by: TRAE CLI <traecli@bytedance.com>

* feat(ragfs): gate existing data reconciliation (#6618)

Add a multi-write backup option to control whether startup scans pre-existing primary files into V2 metadata.

Document the default disabled behavior and the conditions where historical backfill can be skipped.

(cherry picked from commit 56e8bea)
(cherry picked from commit ae29842)

Co-authored-by: TRAE CLI <traecli@bytedance.com>

* perf(admin): 用户列表直接读取内存 (#6629)

(cherry picked from commit 5e45a87)

Co-authored-by: TRAE CLI <traecli@bytedance.com>

* fix(storage): backport PathLock sidecar protocol to v0.5.0 (#6632)

* fix(storage): 修复递归删除导致 PathLock 提前失效

将目录锁迁移到父目录 sidecar,并兼容旧锁与 handoff;删除获锁后重新确认目标状态,避免并发请求沿用过期判断。

(cherry picked from commit 014bd7c)

* test(storage): 补充 PathLock 路径关系矩阵

使用共享文件系统上的独立 Manager 验证祖先、后代与兄弟路径的冲突和非冲突语义,防止 sidecar 迁移引入锁范围回归。

(cherry picked from commit c60e67a)

* fix(storage): 收敛 PathLock sidecar 迁移协议

拆分 Tree 路径解析并修正根路径寻址,撤回无关的 Snapshot 行为变化,同时明确新旧锁协议的切换约束,降低迁移影响范围。

(cherry picked from commit 10ec440)

---------

Co-authored-by: zhanghe.1216 <@bytedance.com>
(cherry picked from commit 36258b3)

Co-authored-by: TRAE CLI <traecli@bytedance.com>

* refactor(session): remove legacy path compatibility

Stop probing obsolete session storage paths during normal operations and
reject the legacy session URI alias. Update bundled callers to use current
session URIs.

(cherry picked from commit 68b1ea6)
(cherry picked from commit 14d622d)

Co-authored-by: TRAE CLI <traecli@bytedance.com>

---------

Co-authored-by: qin-ctx <qinhaojie.exe@bytedance.com>
Co-authored-by: TRAE CLI <traecli@bytedance.com>
Co-authored-by: baojun-zhang <zhangbaojun.1@bytedance.com>
baojun-zhang added a commit that referenced this pull request Nov 4, 2026
…fix (#6976)

* fix(ragfs): backport multiwrite hotfixes to v0.5.0 (#6607)

* fix(ragfs): 在外部租约下跳过冗余加密锁

(cherry picked from commit 002b27f)

* fix(multiwrite): 取消删除 v1 元数据时 glob 操作,在 import account 阶段进行删除 && 增加迁移阶段执行进度日志

(cherry picked from commit 42d99d8)
(cherry picked from commit d8dd90d)

* feat(ragfs): gate existing data reconciliation (#6618)

Add a multi-write backup option to control whether startup scans pre-existing primary files into V2 metadata.

Document the default disabled behavior and the conditions where historical backfill can be skipped.

(cherry picked from commit 56e8bea)
(cherry picked from commit ae29842)

* fix(storage): backport PathLock sidecar protocol to v0.5.0 (#6632)

* fix(storage): 修复递归删除导致 PathLock 提前失效

将目录锁迁移到父目录 sidecar,并兼容旧锁与 handoff;删除获锁后重新确认目标状态,避免并发请求沿用过期判断。

(cherry picked from commit 014bd7c)

* test(storage): 补充 PathLock 路径关系矩阵

使用共享文件系统上的独立 Manager 验证祖先、后代与兄弟路径的冲突和非冲突语义,防止 sidecar 迁移引入锁范围回归。

(cherry picked from commit c60e67a)

* fix(storage): 收敛 PathLock sidecar 迁移协议

拆分 Tree 路径解析并修正根路径寻址,撤回无关的 Snapshot 行为变化,同时明确新旧锁协议的切换约束,降低迁移影响范围。

(cherry picked from commit 10ec440)

---------

Co-authored-by: zhanghe.1216 <@bytedance.com>
(cherry picked from commit 36258b3)

* refactor(session): remove legacy path compatibility

Stop probing obsolete session storage paths during normal operations and
reject the legacy session URI alias. Update bundled callers to use current
session URIs.

(cherry picked from commit 68b1ea6)
(cherry picked from commit 14d622d)

* feat(multiwrite): 多写 IOPS 优化 (#6648)

1. 去除启动 checkpoint ticker,避免重复启动导致的 IOPS 峰值
2. 增加随机值设置初次 checkpoint 时机,防止多实例同时启动导致并发 IOPS 峰值
3. flush worker 使用内存缓存记录account 分区信息,而不是每个 batch 查询 account 分区信息
4. 增加部分进度日志

(cherry picked from commit 3d46710)

* feat(multiwrite): 降低多写元数据 IO (#6688)

- 缓存账号路由快照,减少重复读取分区 manifest
- 记录 dirty scope,让 catch-up 只同步已变更分区
- 使用内存快照维护多写 lag 指标,避免 metrics scrape 扫描元数据
- 降低 catch-up lease 刷新频率,并缩小 append 锁范围以减少 sidecar 写入

(cherry picked from commit b8bc624)

* fix(reindex): converge user orphan vectors

Backport the reindex orphan reconciliation and inventory batching from 6afd9ba to the v0.5.0 task and wait architecture.

Co-authored-by: TRAE CLI <traecli@bytedance.com>
(cherry picked from commit 8ae4f14)

* perf(admin): 用户列表直接读取内存 (#6629)

(cherry picked from commit 5e45a87)

* test(session): seed canonical session path after legacy path removal

14d622d removed legacy session path compatibility; align
test_session_storage_uses_canonical_uri with main (#6642), which seeds
the canonical user/{id}/sessions path.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: baojun-zhang <zhangbaojun.1@bytedance.com>
Co-authored-by: qin-ctx <qinhaojie.exe@bytedance.com>
Co-authored-by: zhoujiahui.01 <zhoujiahui.01@bytedance.com>
Co-authored-by: TRAE CLI <traecli@bytedance.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant